/*!
 * Copyright (C) 2020 - All Rights Reserved by
 * @author : ZhaoYanbo
 * @email  : zyb920@hotmail.com
 * @created: 2020-10-31
 * @version: 1.0.0.0
 *
 */


#ifndef CPIXMAPCACHE_H
#define CPIXMAPCACHE_H

#include <QHash>
#include <QPixmap>

#define PixmapCache CPixmapCache::getInstance()

class CPixmapCache final
{
public:
    static CPixmapCache *getInstance();

    bool insert(const QString &key, const QPixmap &pic);
    bool find(const QString &key, QPixmap &pic);

private:
    CPixmapCache() = default;
    ~CPixmapCache();

    QHash<QString, QPixmap> m_caches;
};

#endif // CPIXMAPCACHE_H
